﻿//--------------------------------------------------------------------
// All Rights Reserved , Copyright (C) 2011 , JiaMingSoft TECH, Ltd. 
//--------------------------------------------------------------------

using System;

// 本系统生成的类库
using DotNet.Utilities;

/// <remarks>
/// Error
/// 错误页面处理
///
///     2011.08.27 版本：1.0  LiangMingMing      创建代码。
///
/// 版本：1.0
///
/// <author>
///		<name>LiangMingMing</name>
///		<date>2011.08.27</date>
/// </author>
/// </remarks>
public partial class Error : System.Web.UI.Page
{
    #region private void Localization() 多语言国际化加载
    /// <summary>
    /// 多语言国际化加载
    /// </summary>
    private void Localization()
    {
        // 多语言国际化加载
        ResourceManagerWrapper.Instance.LoadResources(Server.MapPath("Resource/Localization/"));
        //        
        BaseUserInfo userInfo = Utilities.GetUserInfo();       
        // 获取语言信息
        this.GetLanguageResource(Utilities.GetCurrentLanguage(userInfo));
    }
    #endregion

    #region private void GetLanguageResource(string languages) 获取语言
    /// <summary>
    /// 获取语言
    /// </summary>
    /// <param name="languages">语言类型</param>
    private void GetLanguageResource(string languages)
    {
        // 标题
        this.Title = ResourceManagerWrapper.Instance.Get(languages, "Error.aspx");
        // 错误信息
        this.ltlContent.Text = ResourceManagerWrapper.Instance.Get(languages, "Error.aspx_ltlContent");
        // 联系方式
        this.ltlLink.Text = ResourceManagerWrapper.Instance.Get(languages, "Error.aspx_ltlLink");
        // 详细错误信息
        this.ltlDetail.Text = ResourceManagerWrapper.Instance.Get(languages, "Error.aspx_ltlDetail");
        // 返回上页
        this.ltlBack.Text = ResourceManagerWrapper.Instance.Get(languages, "Error.aspx_ltlBack");
        // 返回首页
        this.ltlBackIndex.Text = ResourceManagerWrapper.Instance.Get(languages, "Error.aspx_ltlBackIndex");
    }
    #endregion

    #region protected void Page_Load(object sender, EventArgs e) 页面初次加载动作
    /// <summary>
    /// 页面初次加载动作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // 加载国际化语言
            this.Localization();
        }
        // 错误信息
        this.txtErrorMsg.Text = Application["error"].ToString();
        // 详细错误信息
        this.lblStackInfo.Text = Application["errorStack"].ToString();
    }
    #endregion
}
